<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="/WEB-INF/config/tld/fmt.tld" prefix="fmt"%>
<%@ taglib uri="http://ssh.org/selects" prefix="ssh"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
	String applicationPath = basePath + "/" + "application";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的工作台</title>
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/jinmu_style.css" />
		<script language="javascript" src="<%=path%>/js/util.js"></script>
		<script language="javascript" src="<%=applicationPath%>/js/main.js"></script>
</head>
<body>
<html:form styleId="workBenchForm" action="workBench.do" styleClass="simple">
<html:hidden property ="type"/>
<html:hidden property ="workitemID"/>
<html:hidden property ="instanceID"/>
<html:hidden property ="bussinessID"/>
<table width="98%" cellspacing="0" cellpadding="0" align="center" border="0" class="margtb5">
  <tr>
    <td width="50%" align="left" valign="top" class="padr5">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
	    <tr>
		  <td class="kuang1"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabbg">
			<tr>
			  <td width="6%" align="center" height="24" ><img src="images/img-11.gif" width="12" height="12"></td>
			  <td width="80%" align="left" class="bai13bold">待办事宜</td>
			  <td width="14%" align="right" class="padr5 baizi"><a href="#" onclick="moreTodoList();">更多...</a></td>
			</tr>
			<tr>
			  <td colspan="3" class="pad5 hei12">  
             <% int count = 0;%>
              <logic:present name="workItemsList">
		     <logic:iterate id="workitem" name="workItemsList">
				<a href="#" onclick="showContent('<bean:write name="workitem" property="type"/>','<bean:write name="workitem" property="workitemID"/>','<bean:write name="workitem" property="instanceID"/>');"><bean:write name="workitem" property="bussinessName" filter="false"/></a>
				<br/>
		     <% count++; %>
             </logic:iterate>
             </logic:present>
               <% 
                    int s = 10-count;
                    if(s>0){
                        for(int i=0;i<s;i++){
                        %>
                          <br/>
                        <%
                        }
                    }
                %>
             </td>
			</tr>
		  </table></td>
	    </tr>
	  </table>
	</td>
	<td width="50%" align="left" valign="top" class="kuang1">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabbg">
	    <tr>
		  <td width="6%" align="center" height="24" ><img src="images/img-11.gif" width="12" height="12"></td>
		  <td width="80%" align="left" class="bai13bold">已办事宜</td>
		  <td width="14%" align="right" class="padr5 baizi"><a href="#" onclick="moreCompleteList();">更多...</a></td>
	    </tr>
	    <tr>
		  <td colspan="3" class="pad5 hei12"> 
		     <% int count2 = 0;%>
		      <logic:present name="workItemsHisList">
		     <logic:iterate id="workitem" name="workItemsHisList">
				<a href="#" onclick="view('<bean:write name="workitem" property="type"/>','<bean:write name="workitem" property="bussinessID"/>');"><bean:write name="workitem" property="bussinessName" filter="false"/></a>
				<br/>
		     <% count2++; %>
             </logic:iterate>
             </logic:present>
               <% 
                    int s2 = 10-count2;
                    if(s2>0){
                        for(int i=0;i<s2;i++){
                        %>
                          <br/>
                        <%
                        }
                    }
            %></td>
	    </tr>
	  </table>
	</td>
  </tr>
</table>
<table width="98%" cellspacing="0" cellpadding="0" align="center" border="0">
  <tr>
    <td width="50%" align="left" valign="top" class="padr5">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
	    <tr>
		  <td class="kuang1"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabbg">
			<tr>
			  <td width="6%" align="center" height="24" ><img src="images/img-11.gif" width="12" height="12"></td>
			  <td width="80%" align="left" class="bai13bold">通知公告</td>
			  <td width="14%" align="right" class="padr5 baizi"><a href="#" onclick="moreNotice();">更多...</a></td>
			</tr>
			<tr>
  <td colspan="3" class="pad5 hei12">
			    <% int count3 = 0;%>
			     <logic:present name="noticeList">
			    <logic:iterate id="notice" name="noticeList">
		          <a href="#" onclick="showNotice('<bean:write name="notice" property="id"/>');">【通知公告】<bean:write name="notice" property="noticeTitle"/></a></br>
		          <% count3++; %>
                </logic:iterate>
                </logic:present>
                <% 
                    int s3 = 10-count3;
                    if(s3>0){
                        for(int i=0;i<s3;i++){
                        %>
                          <br/>
                        <%
                        }
                    }
                %>
			  </td>
			</tr>
		  </table></td>
	    </tr>
	  </table>
	</td>
	<td width="50%" align="left" valign="top" class="kuang1">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabbg">
	    <tr>
		  <td width="6%" align="center" height="24" ><img src="images/img-11.gif" width="12" height="12"></td>
		  <td width="80%" align="left" class="bai13bold">任务指派预警</td>
		  <td width="14%" align="right" class="padr5 baizi"></td>
	    </tr>
	    			<tr>
                <td colspan="3" class="pad5 hei12">
                 <a href="#" onclick="">研发经理</a></br>
                   <a href="#" onclick="">研发中心负责人</a></br>
                    <a href="#" onclick="">研发分管副总</a></br>
			    <% int count4 = 0;%>
			    <logic:present name="earlyWarningList">
			    <logic:iterate id="earlyWarning" name="earlyWarningList">
		          <a href="#" onclick="viewWarningDetail('${earlyWarning.bussinessID}','${earlyWarning.type}','${earlyWarning.inputtimeStr}');">【<font color="red"><ssh:select propertyName="type" pid="warning_type" type="3" defaultName="${earlyWarning.type}"/></font>】<bean:write name="earlyWarning" property="bussinessName"/></a></br>
		          <% count4++; %>
                </logic:iterate>
                </logic:present>
                <% 
                   // int s4 = 10-count4;
                   int s4 = 7-count4;
                    if(s4>0){
                        for(int i=0;i<s4;i++){
                        %>
                          
                        <%
                        }
                    }
                %>
                 
			  </td>
			  
			</tr>
	  </table>
	</td>
  </tr>
</table>
</html:form>
</body>
<script>

//查看具体信息
function showContent(type,workitemID,instanceID){
    $("type").value = type;
    $("workitemID").value = workitemID;
    $("instanceID").value = instanceID;
	document.forms[0].action="workBench.do?method=goToBussiness";
	document.forms[0].submit();
}

function view(type,bussinessID){
    $("type").value = type;
    $("bussinessID").value = bussinessID;
	document.forms[0].action="workBench.do?method=goToBussinessView";
	document.forms[0].submit();
}
//查看通知
function showNotice(id){ 
    document.forms[0].action="workBench.do?method=showNotice&bussinessID=" + id;
	document.forms[0].submit();
    /**var url = "workBench.do?method=showNotice&bussinessID=" + id;
    openWindow(url,1000,600);**/
}

//通知公告列表
function moreNotice(){
	var url = "<%=path%>/listNotice.do?&method=getNoticePartialList";
	window.location = url;
}

//代办列表
function moreTodoList(){
	var url = "<%=path%>/listWorkItem.do?method=getWorkItemList";
	window.location = url;
}

//已办列表
function moreCompleteList(){
	var url = "<%=path%>/listWorkItemHis.do?method=getWorkItemHisList";
	window.location = url;
}

//预警列表
function moreWarning(){
   var url = "<%=path%>/listWarning.do?method=getWarningList";
   window.location = url;
}

//预警提示信息
function viewWarningDetail(bussinessID,type,inputtimeStr){
    var url ="workBench.do?method=operaterEarlyWarning&bussinessID="+bussinessID+"&type=" + type + "&inputtimeStr=" + inputtimeStr;
	var returnValue = showDialog(url);
	/**
	if(returnValue == 1){
	    window.location.reload();
	}
    **/
}
</script>

</html>